//
//  VideoPlayerManager.h
//  BeautyCircle
//
//  Created by xiao_kl on 16/10/20.
//  Copyright © 2016年 MissApp. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

@protocol VCVideoPlayerManagerDelegate <NSObject>

@optional
/** 正在播放*/
-(void)playing;
/** 暂停*/
-(void)pauseing;
/** 正在加载*/
-(void)loding;
/** 播放完毕*/
-(void)endPlay;
/** 网络加载播放失败*/
-(void)playbackailed;
/** 链接播放失败*/
-(void)linkPlaybackailedWithError:(NSError *)error;
 /** 进入后台*/
-(void)AppEnterBackground;
 /** 进入前台*/
-(void)AppEnterForeground;
@end

@interface VCVideoPlayerManager : NSObject

/** 播放URL*/
@property (nonatomic, strong) NSURL *contentURL;

/** 获取当前时间*/
@property(nonatomic,assign) NSTimeInterval currentPlaybackTime;

/** 设置当前时间*/
@property (nonatomic, assign) NSTimeInterval currentProgress;
/** 全部时间*/
@property (nonatomic, assign) NSTimeInterval duration;

/** 获取缓存进度*/
@property (nonatomic, assign) NSTimeInterval bufferingProgress;

// 播放器的Layer
@property (strong, nonatomic) AVPlayerLayer *playerLayer;

 /** 是否可以播*/
@property (nonatomic, readonly, getter=isPlaybackLikelyToKeepUp) BOOL playbackLikelyToKeepUp;

@property (nonatomic ,weak) id<VCVideoPlayerManagerDelegate> delegate;

+(instancetype)PlayManager;

/** 暂停方法*/
-(void)pause;
/** 播放方法*/
-(void)play;
/** 停止*/
-(void)stop;

@end
